import fetch from 'common/src/utils/fetch'


/**
 * 删除
 */
function delete_(idList) {
    return fetch({
        url: '/api/arrangementservice/preArrange',
        method: 'delete',
        data: idList
    });
}

/**
 * 修改
 */
function update(template) {
    return fetch({
        url: '/api/arrangementservice/preArrange',
        method: 'post',
        data: template
    });
}

/**
 * 新增
 */
function add(template) {
    return fetch({
        url: '/api/arrangementservice/preArrange',
        method: 'put',
        data: template
    });
}

/**
 * 查询列表
 */
function searchList(data) {
    return fetch({
        url: '/api/arrangementservice/preArrange/page2?profile&showpre', // TODO page2
        method: 'post',
        data: data
    });
}

function getOtherUseTimes(classId) {
    return fetch({
        url: '/api/arrangementservice/preArrange/otherUseTimes/' + classId,
        method: 'get'
    });
}

function getArrangeRoom(id) {
    return fetch({
        url: '/api/arrangementservice/preArrange/room/' + id,
        method: 'get'
    });
}

/**
 * 设置方向数
 */
function setDir(count,data) {
    return fetch({
        url: '/api/arrangementservice/professionDir/setDir?count='+count,
        method: 'post',
        data: data
    });
}

/**
 * 设置方向数
 */
function getProDir(data) {
    return fetch({
        url: '/api/arrangementservice/professionDir/getProDir',
        method: 'post',
        data: data
    });
}

/**
 * 获取专业方向课表
 */
function getProDirTimetable(data) {
    return fetch({
        url: '/api/arrangementservice/professionDir/getProDirTimetable',
        method: 'post',
        data: data
    });
}

/**
 * 标记方向
 */
function markDir(data) {
    return fetch({
        url: '/api/arrangementservice/teacherClassDir/markDir',
        method: 'post',
        data: data
    });
}

/**
 * 清除标记方向
 */
function clearDir(data) {
    return fetch({
        url: '/api/arrangementservice/teacherClassDir/clearDir',
        method: 'post',
        data: data
    });
}

/**
 * 删除教学班下的方向
 */
function delTeachingClassDir(data) {
    return fetch({
        url: '/api/arrangementservice/teacherClassDir/delTeachingClassDir',
        method: 'post',
        data: data
    });
}

export default {
    "delete_": delete_,
    "update": update,
    "add": add,
    "searchList": searchList,
    "getOtherUseTimes": getOtherUseTimes,
    "getArrangeRoom": getArrangeRoom,
    "setDir": setDir,
    "getProDir": getProDir,
    "getProDirTimetable": getProDirTimetable,
    "markDir": markDir,
    "clearDir": clearDir,
    "delTeachingClassDir": delTeachingClassDir
}
